﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PrimeSplitting
{
    internal class Program
    {
        static void Main(string[] args)
        {
            long num;
            while (true)
            {
                try
                {
                    num = int.Parse(System.Console.ReadLine());
                }
                catch
                {
                    Console.WriteLine("invilid input");
                    num = 0;
                }
                for (int i = 2; i <= num;)
                {
                    if (num % i == 0)
                    {
                        Console.Write(i);
                        Console.Write(" ");
                        while(num%i==0)
                        num /= i;
                    }
                    else
                    {
                        i++;
                    }
                }
            }
        }
    }
}
